﻿//Map - Stage

package  {
	import flash.display.Sprite;

	public class Main extends Sprite{
		
		private var enemies:Array;
		private var heros:Array;
		private var target:Target;
		
		public function Main() {
			
			
			target = new Target(stage.stageWidth,stage.stageHeight / 2);
			addChild(target);
			
			enemies = new Array();
			for (var i:int = 0; i < 10; i++) {
				var speed:Number = 2+Math.random() * 2;
				var en:Enemy = new Enemy(target, speed);
				en.Opposite = heros;
				en.x = 0;
				en.y = Math.random()*stage.stageHeight;
				enemies.push(en);
				addChild(en);
			}
			
			heros = new Array();
			for (var ih:int = 0; ih < 2; ih++) {
				var h:Hero = new Hero(ih);
				h.Opposite = enemies;
				h.x = stage.stageWidth/2 + 150 * ih;
				h.y = stage.stageHeight / 2;
				heros.push(h);
				addChild(h);
			}
		}
		
	}
	
}
